public class ArrayAvg {
    public static void avg(int[] arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {


            sum = sum + arr[i];
        }


        int avg = sum / arr.length;
        System.out.println(avg);
    }

    public static void main(String[] args) {
        int[] array = {2, 4, 6, 8};
        avg(array);
    }
}
